package com.zzsz.domain;

import com.zzsz.common.annotation.Excel;
import com.zzsz.common.core.domain.BaseEntity;
import lombok.Data;

import java.sql.Timestamp;
import java.util.List;
import java.util.Objects;

/**
 * @Classname ProductsCategoriesInventoryVO
 * @Description
 * @Date 2025/9/2 14:35
 * @Created by SYL
 */

@Data
public class ProductsCategoriesInventoryVO extends BaseEntity {

    /**
     * 库存ID
     */
    @Excel(name = "库存ID")
    private  Integer inventoryId;

    /**
     * 商品ID
     */
    private Integer productId;

    /**
     * 商品名称
     */
    @Excel(name = "商品名称")
    private String productName;

    /**
     * 商品SKU编码
     */
    @Excel(name = "SKU")
    private String sku;

    /**
     * 分类ID
     */
    private Integer categoryId;

    /**
     * 分类ID数组
     */
    private List<Integer> categoryIds;

    /**
     * 分类名称
     */
    @Excel(name = "分类名称")
    private String categoryName;

    /**
     * 库存数量
     */
    @Excel(name = "总库存")
    private Integer quantity;

    /**
     * 锁定数量（已下单但未付款）
     */
    @Excel(name = "锁定库存")
    private Integer lockedQuantity;

    /**
     * 可用库存数量
     */
    @Excel(name = "可用库存")
    private Integer availableQuantity;

    /**
     * 最后入库时间
     */
    private Timestamp lastStockInTime;

    /**
     * 最后出库时间
     */
    private Timestamp lastStockOutTime;

    /**
     * 更新时间
     */
    @Excel(name = "更新时间", width = 30)
    private Timestamp updatedAt;

    /**
     * 创建时间
     */
    private Timestamp createdAt;

    /**
     * 上架状态（1：正常；0：禁用）
     */
    @Excel(name = "状态", readConverterExp = "1=上架,0=下架")
    private int status;

    /**
     * 商品图片URI
     */
    private String productImage;


    public ProductsCategoriesInventoryVO() {
    }

    public ProductsCategoriesInventoryVO(Integer inventoryId, Integer productId, String productName, String sku, Integer categoryId, List<Integer> categoryIds, String categoryName, Integer quantity, Integer lockedQuantity, Integer availableQuantity, Timestamp lastStockInTime, Timestamp lastStockOutTime, Timestamp updatedAt, Timestamp createdAt, int status, String productImage) {
        this.inventoryId = inventoryId;
        this.productId = productId;
        this.productName = productName;
        this.sku = sku;
        this.categoryId = categoryId;
        this.categoryIds = categoryIds;
        this.categoryName = categoryName;
        this.quantity = quantity;
        this.lockedQuantity = lockedQuantity;
        this.availableQuantity = availableQuantity;
        this.lastStockInTime = lastStockInTime;
        this.lastStockOutTime = lastStockOutTime;
        this.updatedAt = updatedAt;
        this.createdAt = createdAt;
        this.status = status;
        this.productImage = productImage;
    }

    public Integer getInventoryId() {
        return inventoryId;
    }

    public void setInventoryId(Integer inventoryId) {
        this.inventoryId = inventoryId;
    }

    public Integer getProductId() {
        return productId;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getSku() {
        return sku;
    }

    public void setSku(String sku) {
        this.sku = sku;
    }

    public Integer getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Integer categoryId) {
        this.categoryId = categoryId;
    }

    public List<Integer> getCategoryIds() {
        return categoryIds;
    }

    public void setCategoryIds(List<Integer> categoryIds) {
        this.categoryIds = categoryIds;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public Integer getQuantity() {
        return quantity;
    }

    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }

    public Integer getLockedQuantity() {
        return lockedQuantity;
    }

    public void setLockedQuantity(Integer lockedQuantity) {
        this.lockedQuantity = lockedQuantity;
    }

    public Integer getAvailableQuantity() {
        return availableQuantity;
    }

    public void setAvailableQuantity(Integer availableQuantity) {
        this.availableQuantity = availableQuantity;
    }

    public Timestamp getLastStockInTime() {
        return lastStockInTime;
    }

    public void setLastStockInTime(Timestamp lastStockInTime) {
        this.lastStockInTime = lastStockInTime;
    }

    public Timestamp getLastStockOutTime() {
        return lastStockOutTime;
    }

    public void setLastStockOutTime(Timestamp lastStockOutTime) {
        this.lastStockOutTime = lastStockOutTime;
    }

    public Timestamp getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Timestamp updatedAt) {
        this.updatedAt = updatedAt;
    }

    public Timestamp getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Timestamp createdAt) {
        this.createdAt = createdAt;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getProductImage() {
        return productImage;
    }

    public void setProductImage(String productImage) {
        this.productImage = productImage;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ProductsCategoriesInventoryVO that = (ProductsCategoriesInventoryVO) o;
        return status == that.status && Objects.equals(inventoryId, that.inventoryId) && Objects.equals(productId, that.productId) && Objects.equals(productName, that.productName) && Objects.equals(sku, that.sku) && Objects.equals(categoryId, that.categoryId) && Objects.equals(categoryIds, that.categoryIds) && Objects.equals(categoryName, that.categoryName) && Objects.equals(quantity, that.quantity) && Objects.equals(lockedQuantity, that.lockedQuantity) && Objects.equals(availableQuantity, that.availableQuantity) && Objects.equals(lastStockInTime, that.lastStockInTime) && Objects.equals(lastStockOutTime, that.lastStockOutTime) && Objects.equals(updatedAt, that.updatedAt) && Objects.equals(createdAt, that.createdAt) && Objects.equals(productImage, that.productImage);
    }

    @Override
    public int hashCode() {
        return Objects.hash(inventoryId, productId, productName, sku, categoryId, categoryIds, categoryName, quantity, lockedQuantity, availableQuantity, lastStockInTime, lastStockOutTime, updatedAt, createdAt, status, productImage);
    }

    @Override
    public String toString() {
        return "ProductsCategoriesInventoryVO{" +
                "inventoryId=" + inventoryId +
                ", productId=" + productId +
                ", productName='" + productName + '\'' +
                ", sku='" + sku + '\'' +
                ", categoryId=" + categoryId +
                ", categoryIds=" + categoryIds +
                ", categoryName='" + categoryName + '\'' +
                ", quantity=" + quantity +
                ", lockedQuantity=" + lockedQuantity +
                ", availableQuantity=" + availableQuantity +
                ", lastStockInTime=" + lastStockInTime +
                ", lastStockOutTime=" + lastStockOutTime +
                ", updatedAt=" + updatedAt +
                ", createdAt=" + createdAt +
                ", status=" + status +
                ", productImage='" + productImage + '\'' +
                '}';
    }
}
